//
//  ViewController.m
//  strechImageView
//
//  Created by VD-Dragon on 2018/1/21.
//  Copyright © 2018年 VD-Dragon. All rights reserved.
//
#import "RctButton.h"
#import "ViewController.h"
#import "UIView+Extension.h"
#define WINDOW_HEIGHT               [UIScreen mainScreen].bounds.size.height
#define WINDOW_WIDTH                [UIScreen mainScreen].bounds.size.width
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSString *status_string = @"审核已经过去了ladfaasdifajklsdj";
    CGSize ss = [self getAttributeSizeWithText:status_string fontSize:14];
    RctButton *rct = [[RctButton alloc] initWithFrame:CGRectMake(110,110, ss.width+45, 35) string:status_string];
    [self.view addSubview:rct];
//    rct.status_string = status_string;
   
}

-(CGSize) getAttributeSizeWithText:(NSString *)text fontSize:(int)fontSize
{
    CGSize size=[text sizeWithAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:fontSize]}];
    size=[text sizeWithAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:fontSize]}];

    return size;
}

@end
